//
//  ITShowImageView.h
//  Seven
//
//  Created by admin on 2019/12/22.
//  Copyright © 2016年 Seven. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ITCrossView.h"
@class ITCropImageView;
//@class ShapeItemView;
typedef NS_ENUM(NSInteger, ClipType) {
    ClipTypeRect = 0,
    ClipTypeCycle,
    ClipTypeEllipse,
};
#define DefaultCycleOffset 15
#define DefaultMaxWidth 1500
@interface MaskShadowLyer: CAShapeLayer
@property (nonatomic, strong) UIBezierPath *bezierPath;
@property (nonatomic, assign) CGFloat clipRadius;
@property (nonatomic, assign) ClipType clipType;
@property (nonatomic, assign) CGSize clipSize;
@property (nonatomic, assign) CGSize viewSize;
@property (nonatomic, assign) CGPathRef layerPath;


@property (nonatomic, assign) BOOL showCropLine;
@property (nonatomic, assign) CGFloat cropLineWidth;
@property (nonatomic, strong) UIColor *cropLineColor;
@property (nonatomic, strong) CAShapeLayer *cropLine;

- (instancetype)initWithRaidus:(CGFloat)radius type:(ClipType)type shapeSize:(CGSize)shapeSize viewSize:(CGSize)viewSize;
@end


@interface ITShowImageView : ITCrossView{
    
}

@property (nonatomic, strong) UIImageView *tmpImageView;
@property (nonatomic, strong) UIImageView *zoomImageView;
@property (nonatomic, strong) UIScrollView *zoomScrollView;

@property (nonatomic, assign) CGRect clipRect;

@property(nonatomic, strong)UIImage *image;
@property(nonatomic, strong)UIImage *originImage;
@property(nonatomic, assign)BOOL shouldZoom;
@property(nonatomic, assign)CGFloat minScale;
@property(nonatomic, assign)CGFloat maxScale;
@property(nonatomic, assign)BOOL showFullView;//是否撑满,默认全部展示
@property(nonatomic, assign)BOOL showFullImage;//是否显示全图片

@property(nonatomic, assign)BOOL unLimit;//自由 无限制 任意移动

@property(nonatomic, assign)BOOL newUnLimit;//新 自由 无限制 任意移动

@property(nonatomic, assign)BOOL limitCycle;//限制圆范围内 任意移动

@property(nonatomic, assign)BOOL cropChangeEnable;//裁剪框改变 默认不可变

@property(nonatomic, assign)BOOL scaleChangeEnableInRotation;//旋转时自动适应

@property(nonatomic, strong)UIColor *unLimitBackgroundColor;//自由背色

@property(nonatomic, strong)MaskShadowLyer *shadowLayer;

@property(nonatomic, assign)BOOL blurShadow;
@property(nonatomic, strong)UIImage *blurImage;

@property(nonatomic, assign)BOOL shouldRotate;

@property(nonatomic, assign)CGFloat maxCurrScale;
@property(nonatomic, assign)CGFloat minCurrScale;

@property(nonatomic, strong)UIColor *shadowColor;
@property(nonatomic, assign)CGFloat shadowAlpha;

@property(nonatomic, assign)NSInteger firstOptionType;
@property(nonatomic, assign)NSInteger secondOptionType;


@property (assign, nonatomic) ITCropImageView *cropView;

@property(nonatomic, assign)BOOL hasChanged;//是否改变

@property(nonatomic, assign)BOOL autoAdsorptionEdge;//自动吸附边缘

@property(nonatomic, assign)BOOL longPressEnable;//长按手势

@property(nonatomic, assign)BOOL maskScaleEnable;//缩放遮罩

@property(nonatomic, assign)CGFloat maskWidth;//遮罩宽度 圆下使用

//@property(nonatomic, weak)ShapeItemView *shapeItemView;

- (void)moveImageToCenterWithAnimation:(BOOL)animation;

- (UIImage *)outputImage;


- (void)updateBlurShadow;
- (void)fillShadowWithColor:(UIColor *)color image:(UIImage *)image;

- (void)copyToOtherView:(ITShowImageView *)view;

- (void)updateCropRect:(CGRect)rect reset:(BOOL)reset change:(void (^)(void))change;
- (void)updateImage:(UIImage *)image;
- (void)onlyChangeImage:(UIImage *)image;

- (void)resetRotation;
@end
